local gengsheng = fk.CreateSkill {
  name = "th_gengsheng",
  tags = { Skill.Compulsory },
}

gengsheng:addEffect(fk.TurnEnd, {
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(gengsheng.name) and
    #player.room.logic:getActualDamageEvents(1, function(e) return e.data.from == player and e.data.by_user and e.data.to and e.data.to ~= player end) == 0
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local choices = {"draw2"}
    if player:isWounded() then
      local recover = "recover"
      table.insert(choices, recover)
    end
    local choice = room:askToChoice(player, {
      choices = choices,
      skill_name = gengsheng.name
    })
    if choice == "draw2" then
      player:drawCards(2, gengsheng.name)
    else
      room:recover({
        who = player,
        num = 1,
        recoverBy = player,
        skillName = gengsheng.name
      })
    end
  end,
})

Fk:loadTranslationTable{
  ["th_gengsheng"] = "更生",
  [":th_gengsheng"] = "锁定技，回合结束时，若你本回合内未使用牌对其他角色造成过伤害，你回复1点体力或摸两张牌。",
}

return gengsheng